--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
--boats.ada
--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
package BOATS is

  type OCEAN_NAME is (INDIAN,ATLANTIC,PACIFIC,MEDITERRANEAN,ARCTIC,CARRIBEAN,
      SOUTH_CHINA,BERING,GULF_OF_MEXICO,HUDSON_BAY);
  subtype UNIQUE_OCEAN_NAME is OCEAN_NAME;

  type ANALYST_NAME is new STRING(1..20);
  subtype UNIQUE_ANALYST_NAME is ANALYST_NAME;
  subtype MANAGER_NAME        is UNIQUE_ANALYST_NAME;

  type ANALYST_SALARY is new FLOAT;

  type SHIP_NAME is new STRING(1..15);
  subtype UNIQUE_SHIP_NAME is SHIP_NAME;

  type POSITION_LAT  is new STRING(1..7);
  type POSITION_LONG is new STRING(1..8);

  type POSITION_LATLONG is
    record
      LAT  : POSITION_LAT;
      LONG : POSITION_LONG;
    end record;

  type SHIP_TYPE is (CARRIER,DESTROYER);

  type CREW_SPECIALTY is (COOK,SHUFFLEBOARD_TEACHER);

  type SHIP_CREW is
    record
      TY_PE     : SHIP_TYPE;
      SPECIALTY : CREW_SPECIALTY;
    end record;

  subtype UNIQUE_SHIP_CREW is SHIP_CREW;

  type CREW_COUNT is new INTEGER;

  type OCEAN is
    record
      NAME    : UNIQUE_OCEAN_NAME;
      ANALYST : UNIQUE_ANALYST_NAME;
    end record;

  type ANALYST is
    record
      NAME    : UNIQUE_ANALYST_NAME;
      SALARY  : ANALYST_SALARY;
      MANAGER : MANAGER_NAME;
    end record;

  type SHIP is
    record
      NAME    : UNIQUE_SHIP_NAME;
      OCEAN   : OCEAN_NAME;
      LATLONG : POSITION_LATLONG;
      TY_PE   : SHIP_TYPE;
    end record;

  type CREW is
    record
      KEY    : UNIQUE_SHIP_CREW;
      NUMBER : CREW_COUNT;
    end record;

  subtype SAMPLE_FIRST_LEVEL_SUBTYPE   is ANALYST_NAME;
  subtype SAMPLE_SECOND_LEVEL_SUBTYPE  is SAMPLE_FIRST_LEVEL_SUBTYPE;
  subtype ANOTHER_SECOND_LEVEL_SUBTYPE is SAMPLE_FIRST_LEVEL_SUBTYPE;

  type SAMPLE_SECOND_LEVEL_RECORD is
    record
      FIRST_LEVEL_RECORD : POSITION_LATLONG;
      SCALAR_2           : OCEAN_NAME;
    end record;

  type SAMPLE_THIRD_LEVEL_RECORD is
    record
      SECOND_LEVEL_RECORD : SAMPLE_SECOND_LEVEL_RECORD;
      FIRST_LEVEL_RECORD  : SHIP_CREW;
      SCALAR_3            : CREW_COUNT;
    end record;

end BOATS;
